<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>vue学习</title>
    <script src="./js/vue.js"></script>
  </head>
  <body>
    <div id="app">
      <!-- <a href="http://ts.1314000.cn" @click.prevent="goUrl">学习ts</a> -->
      <!-- <a mhref="http://ts.1314000.cn" @click.prevent="goUrl">学习ts</a> -->
      <a data-href="http://ts.1314000.cn" @click.prevent="goUrl">学习ts</a>
      <hr />
      <!-- <input type="text" @keyup.enter.ctrl="onEnter" /> -->
      <!-- 自定义修饰符 -->
      <input type="text" @keyup.shift.d="onEnter" />
    </div>
    <script>
      const app = Vue.createApp({
        data() {
          return {}
        },
        methods: {
          goUrl(evt) {
            console.log(123)
            // let url = evt.target.href
            // let url = evt.target.getAttribute('mhref')
            let url = evt.target.dataset.href
            console.log(url)
            // window.location.href = url
          },
          onEnter(e) {
            // console.log(e.key)
            // console.log(e.keyCode)
            console.log('回车', e.target.value)
          }
        }
      })
      app.mount('#app')
    </script>
  </body>
</html>
